package homework.student;

import java.util.Objects;

public class Student {
    private String name;
    private String number;
    private String ID;
    private int age;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Student)) return false;
        Student student = (Student) o;
        return getAge() == student.getAge() &&
                getName().equals(student.getName()) &&
                getNumber().equals(student.getNumber()) &&
                getID().equals(student.getID());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getName(), getNumber(), getID(), getAge());
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", number='" + number + '\'' +
                ", ID='" + ID + '\'' +
                ", age=" + age +
                '}';
    }

    public Student(String name, String number, String ID, int age) {
        this.name = name;
        this.number = number;
        this.ID = ID;
        this.age = age;
    }

    public Student() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
